package org.example.xsda.util;

import cn.hutool.crypto.digest.BCrypt;

/**
 * 密码工具类
 */
public class PasswordUtil {

    /**
     * 加密密码
     */
    public static String encrypt(String password) {
        return BCrypt.hashpw(password, BCrypt.gensalt());
    }

    /**
     * 校验密码
     */
    public static boolean verify(String password, String hashed) {
        return BCrypt.checkpw(password, hashed);
    }
}

